const SetUp = require("../model/setUp");
module.exports = {
    // 获取设置信息
    getSetUp: (req, res, next) => {
        SetUp.getSetUp()
            .then((res) => {
                req.setUpData = res;
                next();
            })
            .catch((err) => {
                next(err);
            });
    },
    // 设置网站信息
    updateSetUp: (req, res, next) => {
        const setUpData = req.body
        SetUp.updateSetUp(setUpData)
            .then((resolve) => {
                req.data = resolve;
                next();
            })
            .catch((err) => {
                next(err);
            });
    },
}